<?php

class Social_Adapter_Facebook extends Social_Adapter_OAuthAbstract
{

	/**
	 * @var string
	 */
	protected $_serviceId = 'facebook';

	/**
	 * @return void
	 */
	function __construct()
	{
		require_once LEGACY_DIR . 'social/facebook/facebook.php';
	}

	function getClientApi()
	{

		if (NULL == $this -> _clientApi)
		{

			$key = Nuo::getConfig('facebook','key');
			$secret = Nuo::getConfig('facebook','secret');

			$config = array(
				'appId' => $key,
				'secret' => $secret,
				'cookie' => true
			);

			$this -> _clientApi = new Facebook($config);
		}

		return $this -> _clientApi;
	}

}
